]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell-util: Do not scale the clip in get_content_for_window_actor()
authorRobert Mader <robert.mader@posteo.de>
Sat, 14 Sep 2019 17:24:36 +0000 (19:24 +0200)
committerJonas Ådahl <jadahl@gmail.com>
Fri, 20 Sep 2019 17:27:34 +0000 (17:27 +0000)
This is now handled in Mutter. Also, respect the result size instead
of assuming it to be equal to the clip size, as the clip takes actor
coordinates while the result takes buffer coordinates.

This can be fixed in a future API iteration.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/728

src/shell-util.c

index 3f57ada8d5883aaf3fd1368ac1e37c77f19cc41e..e94f3c364d476c09fbc10ca41fbcceb3dcb93fe5 100644 (file)
@@ -429,28 +429,20 @@ shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
   cairo_surface_t *surface;
   cairo_rectangle_int_t clip;
   gfloat actor_x, actor_y;
-  gfloat resource_scale;
 
   clutter_actor_get_position (CLUTTER_ACTOR (window_actor), &actor_x, &actor_y);
 
-  if (!clutter_actor_get_resource_scale (CLUTTER_ACTOR (window_actor),
-                                         &resource_scale))
-    {
-      resource_scale = 1.0;
-      g_warning ("Actor resource scale is not know at this point, "
-                 "falling back to default 1.0");
-    }
-
   clip.x = window_rect->x - (gint) actor_x;
   clip.y = window_rect->y - (gint) actor_y;
-  clip.width = ceilf (window_rect->width * resource_scale);
-  clip.height = ceilf (window_rect->height * resource_scale);
+  clip.width = window_rect->width;
+  clip.height = window_rect->height;
 
   surface = meta_window_actor_get_image (window_actor, &clip);
 
   content = clutter_canvas_new ();
   clutter_canvas_set_size (CLUTTER_CANVAS (content),
-                           clip.width, clip.height);
+                           cairo_image_surface_get_width (surface),
+                           cairo_image_surface_get_height (surface));
   g_signal_connect (content, "draw",
                     G_CALLBACK (canvas_draw_cb), surface);
   clutter_content_invalidate (content);